/*
 *  lexer.h
 *  framework
 *
 *  Created by gerhard gubler on 15.11.09.
 *  Copyright 2009 md80.ch . All rights reserved.
 *
 */
#ifndef LEXER_H
#define LEXER_H
#include <string>
#include <iterator>

class lexer
{
	std::string::iterator current;
	std::string::iterator last;
	std::string be_lexed;
	bool special_delim;
	bool token;
	std::string specialdelemiter;
	std::string commentchars;
	std::string one_line_comment;
	std::string word;	
	std::string multi_line_comment_begin;
	std::string multi_line_comment_end;
	bool multi_line_comment_begin_set;
	bool multi_line_comment_end_set;

public:
	lexer();
	void lex(std::string );
	bool isdelemiter(char );
	void setdelimiter(std::string );
	void setcommentchars(std::string );
	void setMultiLineCommentBegin(std::string );
	void setMultiLineCommentEnd(std::string );
	bool iscomment(char);
	std::string operator * () const;
	void operator++();
	
	std::iterator<char, std::string> siter;
	std::string::iterator striter;
	bool the_end;
};

#endif